<template>
<div>
  <slot :data="info"></slot>
  <slot></slot>
  <h3>组件一</h3>
  <slot name="slotb">123</slot>
  <!-- <p>{{info}}</p> -->
</div>
</template>

<script>
import bus from '@/test/bus.js'

export default {
  data() {
    return {
      info: 'hello word'
    }
  },
  created() {
    // 监听事件
    bus.$on('datatoone', data => {
      console.log(data)
      this.info = data
    })
  }
}
</script>

<style scoped>

</style>
